<template>
  <!-- 底部部分 -->
  <footer class="footer">
    <span class="todo-count"
      ><strong>{{ listActive }}</strong
      >剩余</span
    >
    <ul class="filters">
      <li>
        <a :class="{selected:listType === 'all'}" href="#/" @click="screenList('all')">全部</a>
      </li>
      <li>
        <a href="#/active" :class="{selected:listType === 'active'}" @click="screenList('active')" >进行中</a>
      </li>
      <li>
        <a href="#/completed" :class="{selected:listType === 'completed'}" @click="screenList('completed')">已完成</a>
      </li>
    </ul>
    <button class="clear-completed" v-show="removeFlag" @click="delAllCompleted">清除已完成</button>
  </footer>
</template>

<script>
export default {
  props: {
    listActive: {
      type: Number,
      require: true,
      default: 0,
    },
    removeFlag:{
      type: Boolean,
      require: true,
    },
    listType:{
      type: String,
      require: true,
    }
    
  },
  methods: {
    // 删除所有已完成事件，传递给父组件
      delAllCompleted(){
        this.$emit('delAllCompleted')
    },
    // 筛选按钮
    screenList(type) {
      this.$emit('screenList', type)
    }
  }
}
</script>

<style></style>
